package com.tenwives.ashop.kernel;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

/**
 * 商品：产品+重量
 */
@AllArgsConstructor
@ToString
@Data
public class Goods {
    Fruit fruit;
    double weight;
    public double getTotal() {
        assert fruit != null;
        return fruit.price * weight;
    }
}
